<?php namespace Home\Model;
use Hdphp\Model\Model;
//前台用户  模型
class User extends Model{
	protected $table = 'user_app';
	public function money(){
//		用户id
		$uid = Q('post.uid',0,'intval');
//		充值的金额
		$balance = Q('post.balance',0,'intval');
//		1、找出与uid对应的数据
		$data = $this->where("uid={$uid}")->find();
		$data['balance'] = $data['balance'] + $balance;
		$this->where("uid={$uid}")->save($data);
		return true;
	}
}




 ?>